#!/usr/bin/ruby
# LOLLERSKATES
# Radif Sharafullin 2010
require 'rubygems'
require 'highline/system_extensions'
include HighLine::SystemExtensions
s1= <<EOT;
   /\\o
    /\\/
   /\\
  /  \\
LOL  LOL
EOT


s3= <<EOT;
    o
   /__
  |\\
 /  |
LOLLOL
EOT

s2= <<EOT;
   _o
  //|__
  |
 /|
LLOL
EOT

s1_lines=s1.split"\n"
s2_lines=s2.split"\n"
s3_lines=s3.split"\n"
delay =0.1
header="\n"
message="\n\n\n\n    :D LOLLERSKATES\nControl + X to exit"

drawingThread=Thread.new{
  leftMargin=0;
  loop do
    leftMargin=0 if leftMargin>=55
    leftMargin=leftMargin+1
  system "clear"
  puts header
  
  s1_lines.each do |line|
    margin=" "*leftMargin
    line=margin+line
    puts line
  end
  
  puts message
  sleep delay
  leftMargin=leftMargin+1
  system "clear"
  
  puts header
  s2_lines.each do |line|
    margin=" "*leftMargin
    line=margin+line
    puts line
  end
  puts message
  sleep delay
  leftMargin=leftMargin+1
  system "clear"
  
  puts header
  s3_lines.each do |line|
    margin=" "*leftMargin
    line=margin+line
    puts line
  end
 

 
  puts message
  sleep delay
end
}


systemThread=Thread.new{
  loop do
    char = get_character
    case char
  	when ?\C-x: print "Exiting...\nLOL\n"; exit;
	  end
    
  end
}
drawingThread.join
systemThread.join